# Contributor: omni <omni+alpine@hack.org>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=daemontools-encore
pkgver=1.11
pkgrel=0
pkgdesc="Enhanced collection of tools for managing UNIX services"
url="http://untroubled.org/daemontools-encore/"
arch="all !riscv64" # ftbfs
license="MIT"
subpackages="$pkgname-doc"
source="https://untroubled.org/daemontools-encore/daemontools-encore-$pkgver.tar.gz
	add-missing-setuser-man-page.patch
	svscan.initd
	"

prepare() {
	echo "$pkgdir/usr/bin" > conf-bin
	echo "$pkgdir/usr/share/man" > conf-man
	echo "${CC:-"gcc"} ${CFLAGS}" > conf-cc
	echo "${CC:-"gcc"} ${LDFLAGS}" > conf-ld
	default_prepare
}

build() {
	make
}

package() {
	install -dm755 "$pkgdir/usr/bin"
	install -dm755 "$pkgdir/usr/share/man"
	make install
	install -Dm755 "$srcdir"/svscan.initd "$pkgdir"/etc/init.d/svscan
}

sha512sums="
1e1a96a948d551bfc38496740eaa85b7cae0d2469419293b133533da75ca03657fe6108129703ad7b773925c58ce84a4f242eb612133fb0c499f47ae50423a8a  daemontools-encore-1.11.tar.gz
2fa48512b13faf6df16b955e496dfebc0c7bf7acfd0fe73530dec3af94a49f2adf95875550d7e48eeb9e78aad065e383a6ecdc678a5af3e474a751dd470205cb  add-missing-setuser-man-page.patch
cfe2d3ef118262f86d5c91a76ffac2f51564e748c4e9392b42ee9f9e13d90729a795c4dfeba5bc3c5793b988fac62a9ca1fb33e685200bf4fcd354d5872d9d1d  svscan.initd
"
